home *** CD-ROM | disk | FTP | other *** search
/ Liberation Day / Liberation Day.bin / AcroRd32.exe / PSPROCSET / 10 < prev    next >
Text File  |  1997-04-23  |  6KB  |  291 lines

  1. %%BeginFile: pdfimg1i.prc
  2. %%Copyright: Copyright 1987-1993 Adobe Systems Incorporated. All Rights Reserved.
  3. PDF /PDFImage get begin
  4. Level2? not StartLoad {
  5. /testsystemdict {
  6. false exch where { systemdict eq { pop true } if } if
  7. } bd
  8. /NDColors 1 def
  9. ColorImage? StartLoad {
  10. /NDColors 0
  11. statusdict begin
  12. /processcolors where {
  13. pop pop processcolors
  14. }{
  15. /deviceinfo where {
  16. pop deviceinfo /Colors known {
  17. pop deviceinfo /Colors get
  18. } if
  19. } if
  20. } ifelse
  21. end
  22. def
  23. NDColors 0 ne {
  24. /colorimage testsystemdict
  25. /setcolortransfer testsystemdict and
  26. /currentcolortransfer testsystemdict and
  27. /currentcmykcolor testsystemdict and not {
  28. /NDColors 0 def
  29. } if
  30. } if
  31. NDColors dup 1 ne exch dup 3 ne exch 4 ne and and {
  32. /NDColors 0 def
  33. }if
  34. } EndLoad
  35. /BaseSpace? { ColorSpace 1 get } bd
  36. NDColors 0 ne StartLoad {
  37. /rgbtogray {
  38. 0.11 mul exch 0.59 mul add exch 0.3 mul add round cvi
  39. } bd
  40. /ConvRGBtoGray {
  41. dup length 3 idiv
  42. 0 1 3 -1 roll 1 sub {
  43. 1 index exch 2 copy 3 mul
  44. 2 copy get 3 1 roll
  45. 2 copy 1 add get 3 1 roll
  46. 2 add get
  47. rgbtogray
  48. put
  49. } for
  50. dup length 3 idiv 0 exch getinterval
  51. } bd
  52. /cmyktogray {
  53. exch 0.11 mul add exch 0.59 mul add exch 0.3 mul add round cvi
  54. dup 255 gt { pop 255 } if
  55. 255 exch sub
  56. } bd
  57. /ConvCMYKtoGray {
  58. dup length 4 idiv
  59. 0 1 3 -1 roll 1 sub {
  60. 1 index exch 2 copy 4 mul
  61. 2 copy get 3 1 roll
  62. 2 copy 1 add get 3 1 roll
  63. 2 copy 2 add get 3 1 roll
  64. 3 add get cmyktogray put
  65. } for
  66. dup length 4 idiv 0 exch getinterval
  67. } bd
  68. /setupgrayclut {
  69. /CIbit1x CIgclut length 1 sub pv
  70. } bd
  71. /1compute {
  72. exch 2 BitsPerComponent exp 1 sub mul round cvi
  73. dup CIbit1x gt { pop pop 0 } { get 255 div } ifelse
  74. } bd
  75. /DoGrayCLUT {
  76. ColorSpace 3 get /CIgclut exch pv setupgrayclut
  77. [ { CIgclut 1compute } /exec load dup currenttransfer exch ]
  78. cvx settransfer
  79. Width Height BitsPerComponent ImageMatrix ImageFilter image
  80. } bd
  81. } EndLoad
  82. NDColors 1 eq StartLoad {
  83. /Indexed [ 1
  84. {
  85. BaseSpace? /DeviceRGB eq {
  86. ColorSpace dup 3 get ConvRGBtoGray 3 exch put
  87. } {
  88. BaseSpace? /DeviceCMYK eq {
  89. ColorSpace dup 3 get ConvCMYKtoGray 3 exch put
  90. } if
  91. } ifelse
  92. DoGrayCLUT
  93. }
  94. ] InstallImage
  95. } EndLoad
  96. NDColors dup 3 eq exch 4 eq or StartLoad {
  97. /NULLPROC {} bd
  98. /concatutil {
  99. /exec load
  100. 7 -1 roll /exec load
  101. } bd
  102. /spconcattransfer {
  103. /Dclut exch pv
  104. /Cclut exch pv
  105. /Bclut exch pv
  106. /Aclut exch pv
  107. /ncompute exch load pv
  108. currentcolortransfer
  109. [ { Aclut ncompute } concatutil ] cvx
  110. [ { Bclut ncompute } concatutil ] cvx
  111. [ { Cclut ncompute } concatutil ] cvx
  112. [ { Dclut ncompute } concatutil ] cvx
  113. setcolortransfer
  114. } bd
  115. /pvsubclut {
  116. 1 add getinterval pv
  117. } bd
  118. } EndLoad
  119. NDColors 3 eq StartLoad {
  120. /cmyktorgb {
  121. dup 5 -1 roll add 255 exch sub 4 1 roll
  122. dup 4 -1 roll add 255 exch sub 3 1 roll
  123. add 255 exch sub
  124. 3 { dup 0 lt { pop 0 } if cvi 3 1 roll } repeat
  125. } bd
  126. /ConvCMYKtoRGB {
  127. dup length 4 idiv
  128. 0 1 3 -1 roll 1 sub {
  129. dup 3 mul exch 4 mul
  130. 2 index exch 4 getinterval { } forall
  131. cmyktorgb
  132. 5 -2 roll 2 copy 7 -1 roll put
  133. 2 copy 1 add 6 -1 roll put
  134. 2 copy 2 add 5 -1 roll put
  135. pop
  136. } bind for
  137. dup length 4 idiv 3 mul 0 exch getinterval
  138. } bd
  139. /setuprgbcluts {
  140. /CIbit3x CIrgbclut length 3 sub pv
  141. /CIrclut CIrgbclut pv
  142. /CIgclut CIrclut 1 CIbit3x pvsubclut
  143. /CIbclut CIrclut 2 CIbit3x pvsubclut
  144. } bd
  145. /3compute {
  146. exch 2 BitsPerComponent exp 3 mul 3 sub
  147. mul
  148. round
  149. cvi
  150. dup CIbit3x gt { pop pop 0 } { get 255 div } ifelse
  151. } bd
  152. /DoRGBCLUT {
  153. ColorSpace 3 get /CIrgbclut exch pv setuprgbcluts
  154. /3compute CIrclut CIgclut CIbclut dup spconcattransfer
  155. Width Height BitsPerComponent ImageMatrix ImageFilter
  156. [ exch /exec load /dup load dup ] cvx /NULLPROC load dup true 3
  157. colorimage
  158. } bd
  159. /Indexed [ 1
  160. {
  161. BaseSpace? /DeviceCMYK eq {
  162. ColorSpace dup 3 get ConvCMYKtoRGB 3 exch put
  163. } if
  164. BaseSpace? /DeviceGray eq { DoGrayCLUT }
  165. { DoRGBCLUT } ifelse
  166. } bind
  167. ] InstallImage
  168. } EndLoad
  169. NDColors 4 eq StartLoad
  170. {
  171. /rgbtocmyk {
  172. 3 { 255 div 3 1 roll } repeat
  173. setrgbcolor currentcmykcolor
  174. 4 { 1 exch sub 255 mul round cvi 4 1 roll } repeat
  175. } bd
  176. /ConvRGBtoCMYK {
  177. dup length 3 idiv
  178. dup 4 mul string 3 1 roll
  179. 0 1 3 -1 roll 1 sub {
  180. dup 4 mul 3 index length 4 sub exch sub
  181. 3 1 roll 3 mul
  182. 1 index exch 3 getinterval {} forall
  183. rgbtocmyk
  184. 7 -2 roll 2 copy 8 -1 roll put
  185. 2 copy 1 add 7 -1 roll put
  186. 2 copy 2 add 6 -1 roll put
  187. 2 copy 3 add 5 -1 roll put
  188. pop exch
  189. } bind for
  190. pop
  191. } bd
  192. /setupcmykcluts {
  193. /CIbit4x CIcmykclut length 4 sub pv
  194. /CIcclut CIcmykclut pv
  195. /CImclut CIcclut 1 CIbit4x pvsubclut
  196. /CIyclut CIcclut 2 CIbit4x pvsubclut
  197. /CIkclut CIcclut 3 CIbit4x pvsubclut
  198. } bd
  199. /4compute {
  200. exch 2 BitsPerComponent exp 4 mul 4 sub mul round cvi
  201. dup CIbit4x gt { pop pop 0 } { get 255 div } ifelse
  202. } bd
  203. /DoCMYKCLUT {
  204. ColorSpace 3 get /CIcmykclut exch pv setupcmykcluts
  205. /4compute CIcclut CImclut CIyclut CIkclut spconcattransfer
  206. Width Height BitsPerComponent ImageMatrix ImageFilter
  207. [ exch /exec load /dup load dup dup ] cvx
  208. /NULLPROC load dup dup true 4 colorimage
  209. } bd
  210. /Indexed [ 1
  211. {
  212. BaseSpace? /DeviceRGB eq {
  213. ColorSpace dup 3 get ConvRGBtoCMYK 3 exch put
  214. } if
  215. BaseSpace? /DeviceGray eq { DoGrayCLUT } { DoCMYKCLUT } ifelse
  216. } bind
  217. ] InstallImage
  218. } EndLoad
  219. NDColors 0 eq StartLoad {
  220. /CICSLookup 3 dict begin
  221. /DeviceGray {
  222. get
  223. put exch
  224. 1 add exch 3 copy
  225. } bd
  226. /DeviceRGB {
  227. 3 mul
  228. 3 getinterval
  229. putinterval exch
  230. 3 add exch 3 copy
  231. } bd
  232. /DeviceCMYK {
  233. 4 mul
  234. 4 getinterval
  235. putinterval exch
  236. 4 add exch 3 copy
  237. } bd
  238. currentdict end pv
  239. /CIBLookup 3 dict begin
  240. 8 { lookupandstore } bd
  241. 4 {
  242. /shiftbyte 1 index pv
  243. -4 bitshift
  244. lookupandstore
  245. shiftbyte 15 and
  246. lookupandstore
  247. } bd
  248. 2 {
  249. /shiftbyte 1 index pv
  250. -6 bitshift
  251. lookupandstore
  252. shiftbyte -4 bitshift
  253. 3 and
  254. lookupandstore
  255. shiftbyte -2 bitshift
  256. 3 and
  257. lookupandstore
  258. shiftbyte 3 and
  259. lookupandstore
  260. } bd
  261. currentdict end pv
  262. /colorexpand {
  263. BufferExp 0 CLUT
  264. 3 copy
  265. 7 -1 roll
  266. /BitLookup load
  267. forall
  268. pop pop pop pop pop
  269. } bd
  270. /Indexed [ 1
  271. {
  272. /CLUT ColorSpace 3 get pv
  273. /BitLookup CIBLookup BitsPerComponent get pv
  274. /lookupandstore BaseSpace? CICSLookup exch get pv
  275. /BufferExp CIBuffer length 8 mul BitsPerComponent idiv
  276. BaseSpace? ColorComps? mul string pv
  277. Width Height 8 ImageMatrix
  278. [
  279. ImageFilter /exec load /colorexpand load /exec load 0
  280. Width BaseSpace? ColorComps? mul /getinterval load /exec
  281. load
  282. ] cvx
  283. BaseSpace? ColorComps? ColorImage
  284. } bind
  285. ] InstallImage
  286. } EndLoad
  287. currentdict readonly pop
  288. } EndLoad
  289. end
  290. %%EndFile
  291.